.TH "storage space for defaults" 3 "30 Jun 2005" "Version 5.2.1.rc3" "net-snmp" \" -*- nroff -*-
.ad l
.nh
.SH NAME
storage space for defaults \- 
.SS "Data Structures"

.in +1c
.ti -1c
.RI "struct \fBnetsnmp_ds_read_config_s\fP"
.br
.in -1c
.SS "Typedefs"

.in +1c
.ti -1c
.RI "typedef netsnmp_ds_read_config_s \fBnetsnmp_ds_read_config\fP"
.br
.in -1c
.SS "Functions"

.in +1c
.ti -1c
.RI "void \fBnetsnmp_ds_handle_config\fP (const char *token, char *line)"
.br
.ti -1c
.RI "int \fBnetsnmp_ds_set_boolean\fP (int storeid, int which, int value)"
.br
.RI "\fIStores 'true' or 'false' given an int value for value into netsnmp_ds_booleans[store][which] slot. \fP"
.ti -1c
.RI "int \fBnetsnmp_ds_toggle_boolean\fP (int storeid, int which)"
.br
.ti -1c
.RI "int \fBnetsnmp_ds_get_boolean\fP (int storeid, int which)"
.br
.ti -1c
.RI "int \fBnetsnmp_ds_set_int\fP (int storeid, int which, int value)"
.br
.ti -1c
.RI "int \fBnetsnmp_ds_get_int\fP (int storeid, int which)"
.br
.ti -1c
.RI "int \fBnetsnmp_ds_set_string\fP (int storeid, int which, const char *value)"
.br
.ti -1c
.RI "char * \fBnetsnmp_ds_get_string\fP (int storeid, int which)"
.br
.ti -1c
.RI "int \fBnetsnmp_ds_set_void\fP (int storeid, int which, void *value)"
.br
.ti -1c
.RI "void * \fBnetsnmp_ds_get_void\fP (int storeid, int which)"
.br
.ti -1c
.RI "int \fBnetsnmp_ds_register_config\fP (u_char type, const char *ftype, const char *token, int storeid, int which)"
.br
.ti -1c
.RI "int \fBnetsnmp_ds_register_premib\fP (u_char type, const char *ftype, const char *token, int storeid, int which)"
.br
.ti -1c
.RI "void \fBnetsnmp_ds_shutdown\fP ()"
.br
.in -1c
.SH "Detailed Description"
.PP 
The purpose of the default storage is three-fold:
.PP
1) To create a global storage space without creating a whole bunch of globally accessible variables or a whole bunch of access functions to work with more privately restricted variables.
.PP
2) To provide a single location where the thread lock- ing needs to be implemented. At the time of this writing, however, thread locking is not yet in place.
.PP
3) To reduce the number of cross dependencies between code pieces that may or may not be linked together in the long run. This provides for a single loca- tion in which configuration data, for example, can be stored for a separate section of code that may not be linked in to the application in question.
.PP
The functions defined here implement these goals.
.PP
Currently, three data types are supported: booleans, inte- gers, and strings. Each of these data types have separate storage spaces. In addition, the storage space for each data type is divided further by the application level. Currently, there are two storage spaces. The first is reserved for the SNMP library itself. The second is intended for use in applications and is not modified or checked by the library, and, therefore, this is the space usable by you.
.PP
These definitions correspond with the 'storid' argument to the API
.IP "\(bu" 2
#define NETSNMP_DS_LIBRARY_ID 0
.IP "\(bu" 2
#define NETSNMP_DS_APPLICATION_ID 1
.IP "\(bu" 2
#define NETSNMP_DS_TOKEN_ID 2
.PP
.PP
These definitions correspond with the 'which' argument to the API, when the storeid argument is NETSNMP_DS_LIBRARY_ID
.PP
library booleans
.PP
.IP "\(bu" 2
#define NETSNMP_DS_LIB_MIB_ERRORS 0
.IP "\(bu" 2
#define NETSNMP_DS_LIB_SAVE_MIB_DESCRS 1
.IP "\(bu" 2
#define NETSNMP_DS_LIB_MIB_COMMENT_TERM 2
.IP "\(bu" 2
#define NETSNMP_DS_LIB_MIB_PARSE_LABEL 3
.IP "\(bu" 2
#define NETSNMP_DS_LIB_DUMP_PACKET 4
.IP "\(bu" 2
#define NETSNMP_DS_LIB_LOG_TIMESTAMP 5
.IP "\(bu" 2
#define NETSNMP_DS_LIB_DONT_READ_CONFIGS 6
.IP "\(bu" 2
#define NETSNMP_DS_LIB_MIB_REPLACE 7 replace objects from latest module
.IP "\(bu" 2
#define NETSNMP_DS_LIB_PRINT_NUMERIC_ENUM 8 print only numeric enum values
.IP "\(bu" 2
#define NETSNMP_DS_LIB_PRINT_NUMERIC_OIDS 9 print only numeric enum values
.IP "\(bu" 2
#define NETSNMP_DS_LIB_DONT_BREAKDOWN_OIDS 10 dont print oid indexes specially
.IP "\(bu" 2
#define NETSNMP_DS_LIB_ALARM_DONT_USE_SIG 11 don't use the alarm() signal
.IP "\(bu" 2
#define NETSNMP_DS_LIB_PRINT_FULL_OID 12 print fully qualified oids
.IP "\(bu" 2
#define NETSNMP_DS_LIB_QUICK_PRINT 13 print very brief output for parsing
.IP "\(bu" 2
#define NETSNMP_DS_LIB_RANDOM_ACCESS 14 random access to oid labels
.IP "\(bu" 2
#define NETSNMP_DS_LIB_REGEX_ACCESS 15 regex matching to oid labels
.IP "\(bu" 2
#define NETSNMP_DS_LIB_DONT_CHECK_RANGE 16 don't check values for ranges on send
.IP "\(bu" 2
#define NETSNMP_DS_LIB_NO_TOKEN_WARNINGS 17 no warn about unknown config tokens
.IP "\(bu" 2
#define NETSNMP_DS_LIB_NUMERIC_TIMETICKS 18 print timeticks as a number
.IP "\(bu" 2
#define NETSNMP_DS_LIB_ESCAPE_QUOTES 19 shell escape quote marks in oids
.IP "\(bu" 2
#define NETSNMP_DS_LIB_REVERSE_ENCODE 20 encode packets from back to front
.IP "\(bu" 2
#define NETSNMP_DS_LIB_PRINT_BARE_VALUE 21 just print value (not OID = value)
.IP "\(bu" 2
#define NETSNMP_DS_LIB_EXTENDED_INDEX 22 print extended index format [x1][x2]
.IP "\(bu" 2
#define NETSNMP_DS_LIB_PRINT_HEX_TEXT 23 print ASCII text along with hex strings
.IP "\(bu" 2
#define NETSNMP_DS_LIB_PRINT_UCD_STYLE_OID 24 print OID's using the UCD-style prefix suppression
.IP "\(bu" 2
#define NETSNMP_DS_LIB_READ_UCD_STYLE_OID 25 require top-level OIDs to be prefixed with a dot
.IP "\(bu" 2
#define NETSNMP_DS_LIB_HAVE_READ_PREMIB_CONFIG 26 have the pre-mib parsing config tokens been processed
.IP "\(bu" 2
#define NETSNMP_DS_LIB_HAVE_READ_CONFIG 27 have the config tokens been processed
.IP "\(bu" 2
#define NETSNMP_DS_LIB_QUICKE_PRINT 28
.IP "\(bu" 2
#define NETSNMP_DS_LIB_DONT_PRINT_UNITS 29 don't print UNITS suffix
.IP "\(bu" 2
#define NETSNMP_DS_LIB_NO_DISPLAY_HINT 30 don't apply DISPLAY-HINTs
.IP "\(bu" 2
#define NETSNMP_DS_LIB_16BIT_IDS 31 restrict requestIDs, etc to 16-bit values
.IP "\(bu" 2
#define NETSNMP_DS_LIB_DONT_PERSIST_STATE 32 don't save/load any persistant state
.IP "\(bu" 2
#define NETSNMP_DS_LIB_2DIGIT_HEX_OUTPUT 33 print a leading 0 on hex values <= 'f'
.PP
.PP
library integers
.PP
.IP "\(bu" 2
#define NETSNMP_DS_LIB_MIB_WARNINGS 0
.IP "\(bu" 2
#define NETSNMP_DS_LIB_SECLEVEL 1
.IP "\(bu" 2
#define NETSNMP_DS_LIB_SNMPVERSION 2
.IP "\(bu" 2
#define NETSNMP_DS_LIB_DEFAULT_PORT 3
.IP "\(bu" 2
#define NETSNMP_DS_LIB_OID_OUTPUT_FORMAT 4
.IP "\(bu" 2
#define NETSNMP_DS_LIB_STRING_OUTPUT_FORMAT 5
.PP
.PP
library strings
.PP
.IP "\(bu" 2
#define NETSNMP_DS_LIB_SECNAME 0
.IP "\(bu" 2
#define NETSNMP_DS_LIB_CONTEXT 1
.IP "\(bu" 2
#define NETSNMP_DS_LIB_PASSPHRASE 2
.IP "\(bu" 2
#define NETSNMP_DS_LIB_AUTHPASSPHRASE 3
.IP "\(bu" 2
#define NETSNMP_DS_LIB_PRIVPASSPHRASE 4
.IP "\(bu" 2
#define NETSNMP_DS_LIB_OPTIONALCONFIG 5
.IP "\(bu" 2
#define NETSNMP_DS_LIB_APPTYPE 6
.IP "\(bu" 2
#define NETSNMP_DS_LIB_COMMUNITY 7
.IP "\(bu" 2
#define NETSNMP_DS_LIB_PERSISTENT_DIR 8
.IP "\(bu" 2
#define NETSNMP_DS_LIB_CONFIGURATION_DIR 9
.IP "\(bu" 2
#define NETSNMP_DS_LIB_SECMODEL 10
.IP "\(bu" 2
#define NETSNMP_DS_LIB_MIBDIRS 11
.IP "\(bu" 2
#define NETSNMP_DS_LIB_OIDSUFFIX 12
.IP "\(bu" 2
#define NETSNMP_DS_LIB_OIDPREFIX 13
.IP "\(bu" 2
#define NETSNMP_DS_LIB_CLIENT_ADDR 14
.IP "\(bu" 2
#define NETSNMP_DS_LIB_TEMP_FILE_PATTERN 15
.IP "\(bu" 2
#define NETSNMP_DS_LIB_AUTHMASTERKEY 16
.IP "\(bu" 2
#define NETSNMP_DS_LIB_PRIVMASTERKEY 17
.IP "\(bu" 2
#define NETSNMP_DS_LIB_AUTHLOCALIZEDKEY 18
.IP "\(bu" 2
#define NETSNMP_DS_LIB_PRIVLOCALIZEDKEY 19 
.PP

.SH "Function Documentation"
.PP 
.SS "int netsnmp_ds_set_boolean (int storeid, int which, int value)"
.PP
Stores 'true' or 'false' given an int value for value into netsnmp_ds_booleans[store][which] slot. 
.PP
\fBParameters:\fP
.RS 4
\fIstoreid\fP an index to the boolean storage container's first index(store)
.br
\fIwhich\fP an index to the boolean storage container's second index(which)
.br
\fIvalue\fP if > 0, 'true' is set into the slot otherwise 'false'
.RE
.PP
\fBReturns:\fP
.RS 4
Returns SNMPPERR_GENERR if the storeid and which parameters do not correspond to a valid slot, or SNMPERR_SUCCESS otherwise. 
.RE
.PP

.PP
Definition at line 197 of file default_store.c.
.PP
Referenced by init_agent().
